// 响应式断点
$breakpoints: (
  'xs': 480px,   // 小手机
  'sm': 768px,   // 大手机
  'md': 992px,   // 平板
  'lg': 1200px,  // 小屏电脑
  'xl': 1920px   // 大屏电脑
);

// 媒体查询混合器
@mixin respond-to($breakpoint) {
  @if map-has-key($breakpoints, $breakpoint) {
    @media screen and (max-width: map-get($breakpoints, $breakpoint)) {
      @content;
    }
  }
}

// 通用容器样式
.page-container {
  min-height: 100vh;
  background-color: #f4f5f5;
  padding: 24px 0;

  @include respond-to('sm') {
    padding: 12px 0;
  }

  @include respond-to('xs') {
    padding: 8px 0;
  }
}

.content-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;

  @include respond-to('lg') {
    max-width: 960px;
  }

  @include respond-to('md') {
    max-width: 100%;
    padding: 0 16px;
  }

  @include respond-to('sm') {
    padding: 0 12px;
  }

  @include respond-to('xs') {
    padding: 0 8px;
  }
}

// 通用卡片样式
.common-card {
  background: #fff;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid #f0f0f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);

  @include respond-to('sm') {
    padding: 12px;
    margin-bottom: 12px;
  }

  @include respond-to('xs') {
    padding: 12px;
    margin-bottom: 8px;
  }
}

// 通用按钮样式
.primary-button {
  border-radius: 20px;
  height: 40px;
  padding: 0 24px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1890ff;
  border: none;
  box-shadow: 0 2px 8px rgba(24, 144, 255, 0.15);

  @include respond-to('sm') {
    width: 100%;
    justify-content: center;
  }
}

// 通用文本样式
.title-text {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;

  @include respond-to('sm') {
    font-size: 15px;
  }

  @include respond-to('xs') {
    font-size: 14px;
  }
}

.normal-text {
  font-size: 14px;
  line-height: 1.6;
  color: #666;

  @include respond-to('xs') {
    font-size: 13px;
    line-height: 1.5;
  }
}

.small-text {
  font-size: 13px;
  color: #8c8c8c;

  @include respond-to('xs') {
    font-size: 12px;
  }
}

// 通用图片容器
.image-container {
  max-height: 200px;
  overflow: hidden;
  border-radius: 4px;

  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
  }

  @include respond-to('xs') {
    max-height: 180px;
  }
}

// 通用网格布局
.grid-layout {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;

  @include respond-to('lg') {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  @include respond-to('md') {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  @include respond-to('sm') {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

// 通用列表样式
.list-layout {
  display: flex;
  flex-direction: column;
  gap: 16px;

  @include respond-to('sm') {
    gap: 12px;
  }

  @include respond-to('xs') {
    gap: 8px;
  }
}

// 通用表单样式
.form-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px;

  @include respond-to('sm') {
    padding: 16px;
  }

  @include respond-to('xs') {
    padding: 12px;
  }

  .form-item {
    margin-bottom: 24px;

    @include respond-to('sm') {
      margin-bottom: 16px;
    }

    @include respond-to('xs') {
      margin-bottom: 12px;
    }
  }
}

// 通用返回顶部按钮
.back-to-top {
  position: fixed;
  right: 40px;
  bottom: 40px;
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s;
  z-index: 99;

  @include respond-to('sm') {
    right: 16px;
    bottom: 16px;
  }
}

// 通用加载状态
.loading-container {
  text-align: center;
  margin: 20px 0;
  padding: 20px 0;

  .loading-text {
    margin-left: 8px;
    color: #999;
    font-size: 14px;

    @include respond-to('xs') {
      font-size: 12px;
    }
  }
}

// 通用分割线
.divider {
  height: 1px;
  background-color: #f0f0f0;
  margin: 16px 0;

  @include respond-to('sm') {
    margin: 12px 0;
  }
} 